#ifndef BUZZERCONTROLLER_H
#define BUZZERCONTROLLER_H

#include <QObject>
#include <QVariantMap>
#include <QTime>
#include <QFileSystemWatcher>
#include <QTimer>
#include "audioplayer.h"

class BuzzerController : public QObject
{
    Q_OBJECT
public:
    explicit BuzzerController(const QString &configFile, QObject *parent = 0);
    
signals:
    
public slots:
    
private slots:
    void autoPlayDirChange(const QString &dirPath);
    void scheduleTimeout();

private:
    void initSchedule();

    QVariantMap m_config;

    QVector< QPair<QTime, QString> > m_schedule; // time - melody
    QTimer *m_scheduleTimer;
    int m_scheduleIndex;

    QFileSystemWatcher *m_fsWatcher;

    AudioPlayer *m_player;
};
#endif // BUZZERCONTROLLER_H
